package com.wrk._1_语法._03_分支;

import java.util.Scanner;

public class _002_根据输入的x值输出y1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入x值：");
        //等待输入
        int y;
        int x = scanner.nextInt();
        //判断
        if (x <= 0) {
            if (x == 0) {
                y = 0;
            } else {
                y = -1;
            }
        }else {
            y = 1;
        }
        System.out.println("y=" + y);
        scanner.close();
    }
}


